// dao/matchMessageSqlMapping.js
// CRUD SQL语句
var matchMessage = {
  update:'UPDATE ummor_match_message set game_status=?  where match_msg_id=?',
  updateMatch:'update ummor_league set STATUS=? where league_id in (select union_id from ummor_match_message  where match_msg_id =?)',
  update_user_score:'update ummor_match_team_signin_member set score=score+1 where union_id in (select union_id from ummor_match_message where match_msg_id =?) and user_id=?',
  update_match_msg_score:'update ummor_match_message set host_team_score =?, away_team_score =? where match_msg_id=? ',
  //select_match_msg_status_count:'select count(0) from ummor_live_last_status where match_msg_id=?',
  insert_match_msg_status:'insert into ummor_live_last_status values(?,?,?,?,?,?,?,?)',
  update_match_msg_status:'update ummor_live_last_status set sport_id=? ,home_team_score=? ,guest_team_score=? ,game_time=? ,all_seconds=? ,last_stage=? ,last_score_text=? where match_msg_id=?',
  select_match_msg_status:'select concat(match_msg_id) match_msg_id,concat(sport_id) sport_id,concat(home_team_score) home_team_score,concat(guest_team_score) guest_team_score,game_time,concat(all_seconds) all_seconds,last_stage,last_score_text from ummor_live_last_status where match_msg_id=?',
  select_match_msg:'select host_team_id,away_team_id,host_team_score,away_team_score from ummor_match_message where match_msg_id=?',
  //update_match_msg:'',
  update_match_team_signin:'update ummor_match_team_signin set score=score+?,victory=victory+?,fail=fail+?,abandon=abandon+? where team_id=? and union_id in (select union_id from ummor_match_message where match_msg_id=?)',
};

module.exports = matchMessage;